<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div class="Showroom-parent" v-if="props.info.digitalShowroom">
      <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
    </div>
    <img
      class="outline-parent-bg"
      :src="publicUrls + 'free/style6/Level1outlineStyle4Bg.webp'"
      alt=""
      v-if="props.info.value || props.info.subTitle || props.info.remarks"
    />
    <img
      class="outline-parent-bg"
      :src="publicUrls + 'free/style6/Level1outlineStyle4Bg2.webp'"
      alt=""
      v-else
    />
    <div
      class="outline jy-style-height"
      :style="!props.info.value && { paddingBottom: 0 }"
      v-if="props.info.value || props.info.subTitle || props.info.remarks"
    >
      <div class="outline-content">
        <div class="content-title">
          <span>{{ props.info.text }} </span>
        </div>
        <p class="outline-subTitle" v-if="props.info.subTitle">—{{ props.info.subTitle }}</p>
        <div class="cover" v-if="props.info.value" :style="!props.info.subTitle && { marginTop: 0 }">
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
        <TextMax
          v-if="props.domShow"
          :class="!props.info.value && 'remarksMargin'"
          :data="props.info.remarks"
          :infoData="props.info"
          :title="props.info.text"
          :row="props.info.value ? 7 : 18"
        ></TextMax>
      </div>
    </div>
    <div class="outline jy-style-height" :style="{ justifyContent: 'flex-start' }" v-else>
      <div class="content-title title2" v-html="textType(props.info.text)"></div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free6Style4',
});
</script>

<script setup lang="ts">
import ExpandableText from './../../../textMode/ExpandableText.vue';
import { publicUrls } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style6.vue';
import { textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, nextTick, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();
const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-top: 0;
  margin-right: 280px;
}
.outline-parent-bg {
  width: 590px;
  height: calc(100%);
}
.Showroom-parent {
  position: absolute;
  top: 22px;
  right: 53px;
  z-index: 21;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-top: 22px;
  padding-bottom: 80px;
}
.outline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 416px;
  height: 100%;
}
.title2 {
  height: 384px !important;
  padding-top: 48px;
  ::v-deep p {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 4px;
    font-family: SourceHanSerifCN-Bold;
    font-size: 32px;
    line-height: 48px;
    text-align: center;
    color: #737d87;
  }
}
.content-title {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 290px;
  height: 96px;
  margin-bottom: 46px;
  span {
    font-family: SourceHanSerifCN-Bold;
    font-size: 32px;
    line-height: 48px;
    text-align: center;
    color: #737d87;
  }
}

.outline-subTitle {
  width: 100%;
  text-align: center;
  font-family: SourceHanSerifCN;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  color: #686763;
}
.cover {
  display: flex;
  align-items: center;
  width: 100%;
  flex: 1;
  max-height: 577px;
  margin: 20px 0;
  background: rgba(222, 217, 211, 0.5);
  overflow: hidden;
  &:hover .outline-cover {
    transform: scale(1.2);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}

.remarksMargin {
  margin-top: 24px;
}

::v-deep .van-text-ellipsis {
  font-family: PingFang SC !important;
  font-size: 16px !important;
  color: #686763 !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #737d87 !important;
  font-weight: 800 !important;
}
</style>